package com.kfm.base.collection;


import java.util.Stack;

public class StackDemo {

    public static void main(String[] args) {
        Stack stack = new Stack();

        stack.push(1);
        stack.push(2);
        stack.push(3);
        stack.push(4);
        stack.push(5);

        System.out.println(stack.indexOf(1)); // 0
//        System.out.println(stack.pop()); // 5
//        System.out.println(stack.peek()); // 4

//        System.out.println(stack.search(1));
        System.out.println(stack.search(1));
    }
}
